
#import <UIKit/UIKit.h>


#define loveLateAppREF_DOWN(scrollView,action) scrollView.mj_header = [MJRefreshStateHeader headerWithRefreshingBlock:action];
#define loveLateAppREF_UP(scrollView,action) scrollView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:action];

typedef enum{
    
    DznEmptyDataTypeDefault = 0,  //默认隐藏
    DznEmptyDataTypeSuccess,      //没有更多数据
    DznEmptyDataTypeFailed        //网络错误
    
} DznEmptyDataType;

NS_ASSUME_NONNULL_BEGIN

@protocol DZNEmptyDataSetSource;
@protocol DZNEmptyDataSetDelegate;

#define DZNEmptyDataSetDeprecated(instead) DEPRECATED_MSG_ATTRIBUTE(" Use " # instead " instead")


@interface UIScrollView (EmptyDataSet)


@property (nonatomic, weak, nullable) IBOutlet id <DZNEmptyDataSetSource> emptyDataSetSource;

@property (nonatomic, weak, nullable) IBOutlet id <DZNEmptyDataSetDelegate> emptyDataSetDelegate;

@property (nonatomic, readonly, getter = isEmptyDataSetVisible) BOOL emptyDataSetVisible;


- (void)reloadEmptyDataSet;

@end

@protocol DZNEmptyDataSetSource <NSObject>
@optional


- (nullable NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView;


- (nullable NSAttributedString *)descriptionForEmptyDataSet:(UIScrollView *)scrollView;


- (nullable UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView;



- (nullable UIColor *)imageTintColorForEmptyDataSet:(UIScrollView *)scrollView;


- (nullable CAAnimation *)imageAnimationForEmptyDataSet:(UIScrollView *)scrollView;


- (nullable NSAttributedString *)buttonTitleForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state;


- (nullable UIImage *)buttonImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state;


- (nullable UIImage *)buttonBackgroundImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state;


- (nullable UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView;


- (nullable UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView;


- (CGPoint)offsetForEmptyDataSet:(UIScrollView *)scrollView DZNEmptyDataSetDeprecated(-verticalOffsetForEmptyDataSet:);
- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView;

- (CGFloat)spaceHeightForEmptyDataSet:(UIScrollView *)scrollView;

@end


@protocol DZNEmptyDataSetDelegate <NSObject>
@optional


- (BOOL)emptyDataSetShouldFadeIn:(UIScrollView *)scrollView;


- (BOOL)emptyDataSetShouldBeForcedToDisplay:(UIScrollView *)scrollView;


- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView;


- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView;


- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView;


- (BOOL)emptyDataSetShouldAnimateImageView:(UIScrollView *)scrollView;


- (void)emptyDataSetDidTapView:(UIScrollView *)scrollView DZNEmptyDataSetDeprecated(-emptyDataSet:didTapView:);

- (void)emptyDataSetDidTapButton:(UIScrollView *)scrollView DZNEmptyDataSetDeprecated(-emptyDataSet:didTapButton:);


- (void)emptyDataSet:(UIScrollView *)scrollView didTapView:(UIView *)view;

- (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button;


- (void)emptyDataSetWillAppear:(UIScrollView *)scrollView;


- (void)emptyDataSetDidAppear:(UIScrollView *)scrollView;


- (void)emptyDataSetWillDisappear:(UIScrollView *)scrollView;


- (void)emptyDataSetDidDisappear:(UIScrollView *)scrollView;

@end

@interface EmptyConfiguer:NSObject

@property (nonatomic,assign) DznEmptyDataType emptyType;
@property (nonatomic,strong) UIImage *successImage;
@property (nonatomic,strong) UIImage *failedImage;
@property (nonatomic,strong) NSString *successTitle;
@property (nonatomic,strong) NSString *failedTitle;
@property (nonatomic,assign) CGFloat ySpace;
@property (nonatomic,assign) CGFloat yOffset;
+(instancetype)defaultConfiguer;
@end

@interface UIScrollView (DznConfigurer)<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>

@property(nonatomic,strong) EmptyConfiguer *configuer;

@end

#undef DZNEmptyDataSetDeprecated

NS_ASSUME_NONNULL_END
